{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/builder/css/base.css" media="all">
<style>
	.layui-form-item {
		margin-bottom: 15px !important;
		clear: both;
		*zoom: 1;
	}
	.goBack{
		float: left;cursor:pointer;
		font-weight: bold;
		font-size: 15px;
	}
	.center{
		font-weight: bold;
		font-size: 15px;
	}
</style>
<body>
<div class="layui-fluid layui-anim layui-anim-downbit">
	<div class="layui-card">
		<div class="layui-card-body" style="padding: 15px;">
			<form action="{:url('save')}" class="layui-form" id="form">
				<div class="layui-form-item">
					<label class="layui-form-label">配置标识</label>
					<div class="layui-input-block">
						<input type="text" name="name" placeholder="用于config函数调用，只能使用英文且不能重复" lay-verify="required" class="layui-input"/>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">配置标题</label>
					<div class="layui-input-block">
						<input type="text" name="title" placeholder="用于后台显示的配置标题" lay-verify="required" class="layui-input"/>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">配置描述</label>
					<div class="layui-input-block">
						<input type="text" name="remark" placeholder="配置描述" lay-verify="required" class="layui-input"/>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">配置类型</label>
					<div class="layui-input-inline">
						<select name="type" lay-filter="call_type">
							<option value="">请选择</option>
							<?php foreach(get_config_type() as $k=>$v){?>
							{if $k > 0}
							<option value="<?php echo $k; ?>"><?php echo $v; ?></option>
							{/if}
							<?php }?>
						</select>
					</div>
					<span style="float:left;margin-top: 10px;" >
				如选择“区间”类型,value值将被解析成逗号拼接格式(例如100,1000)
			</span>
				</div>

				<div class="layui-form-item" id="suffix">
					<label class="layui-form-label">后缀</label>
					<div class="layui-input-inline">
						<select name="suffix">
							<option value="">请选择</option>
							<?php foreach(get_suffix() as $k=>$v){?>
							<option value="<?php echo $v; ?>"><?php echo $v; ?></option>
							<?php }?>
						</select>
					</div>
					<span style="float:left;margin-top: 10px;" >
				显示在配置值的后边，仅支持字符、数字、区间类型，例如:200 元(如不需要请忽略)</a>
			</span>
				</div>
				<div class="layui-form-item" id="time_format">
					<label class="layui-form-label">时间格式</label>
					<div class="layui-input-inline">
						<select name="format">
							<option value="">请选择</option>
							<?php foreach(get_layDate_type() as $k=>$v){?>
							<option value="<?php echo $k; ?>"><?php echo $v; ?></option>
							<?php }?>
						</select>
					</div>
					<span style="float:left;margin-top: 10px;" >
				具体样式参考:<a target="_blank" href="https://www.layui.com/demo/laydate.html">https://www.layui.com/demo/laydate.html</a>
			</span>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">配置分组</label>
					<div class="layui-input-inline">
						<select name="group">
							<option value="0">请选择</option>
							<?php foreach(get_config_group() as $k=>$v){?>
							<option value="<?php echo $k; ?>"><?php echo $v; ?></option>
							<?php }?>
						</select>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">配置值</label>
					<div class="layui-input-block">
						<input type="text" name="value" placeholder="用于config函数调用显示的值如果是日期型需添加后在编辑日期" class="layui-input"/>
					</div>
				</div>


				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">配置项</label>
					<div class="layui-input-block">
						<textarea class="layui-textarea" name="extra" placeholder="如果是枚举型 需要配置该项"></textarea>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">排序</label>
					<div class="layui-input-block">
						<input type="text" name="sort" placeholder="用于显示的顺序" lay-verify="required" class="layui-input"/>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<div class="layui-form-item layui-layout-admin">
	<div class="layui-input-block">
		<div class="layui-footer" style="left: 0;">
			<button class="layui-btn" data-back-url="{:url('config/create')}" lay-filter="save" lay-submit formObj="#form">保存</button>
		</div>
	</div>
</div>
</body>

{include file="public/footer" /}
</html>